-- GENERATED SPELL FOR [Vilebranch Shadowcaster] --


function spell0_2642(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2642', 3000, 1)
end

function spell1_2642(pUnit, Event) --@Shrink,n/a--
pUnit:FullCastSpellOnTarget(7289,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2642', 3000, 1)
end

function spell2_2642(pUnit, Event) --@Summon Voidwalker,Self--
pUnit:FullCastSpellOnTarget(12746,pUnit)
pUnit:RegisterEvent('Sorts_2642', 624, 1)
end

function Sorts_2642(pUnit, Event)
local choix_sorts_2642 = math.random(0, 2)
if choix_sorts_2642 == 0 then
pUnit:RegisterEvent('spell0_2642', 1, 1)
end
if choix_sorts_2642 == 1 then
pUnit:RegisterEvent('spell1_2642', 1, 1)
end
if choix_sorts_2642 == 2 then
pUnit:RegisterEvent('spell2_2642', 1, 1)
end
end

function mob2642_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2642', math.random(1500, 3000), 1)
end

function mob2642_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2642_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2642_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2642, 1, 'mob2642_Action')
RegisterUnitEvent(2642, 2, 'mob2642_Leave')
RegisterUnitEvent(2642, 3, 'mob2642_Kill')
RegisterUnitEvent(2642, 4, 'mob2642_Die')
